import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-07-28
 * Time: 18:48
 */
public class test99 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String []arr= a.split("-");
        String A= arr[0];
        String B=arr[1];
        if(A.equals("joker JOKER")){
            System.out.println("joker JOKER");
        } else if (B.equals("joker JOKER")) {
            System.out.println("joker JOKER");
        }else {
            if(A.length()!=B.length()){
                System.out.println("ERROR");
            }else {
                System.out.println(A);
            }
        }
    }
}
